# with open('./test2.txt', 'r') as f:
#     res = f.read()
# list1 = res.split("$")
# for i in list1:
#     num = 0
#     # for j in i.split("@"):
#     #     print(num, j)
#     #     num += 1
#     l = i.split("@")
#     print(l[4],l[7],l[8],l[12],l[13],l[16],l[19])
#     # print(i.split("@")[8])
# exit()
#     # print(i.split("@")[4], i.split("@")[7], i.split("@")[8], i.split("@")[13])
#
# a = '3869663@前门内饰及附件@../Ext/image/img.png@02823-V7055@0@2015/12/23 0:00:00@2016/2/4 0:00:00@0@1@@2010@@1@1@V705G 2.0T+5AT公务侧挂2016款@66467917@1@前门内饰及附件 02823-V7055@@0@'

# from mytools import check_time
# import time
# _dc = str(time.time()).replace('.','')[:13]
# print(_dc)
# print(check_time(start='08:00', end='17:00'))

# base_url = 'http://218.104.65.183:8080/Ext/UpFile/76a2630c3bd1c4d65c8098e43a3bf6ef.png'
# cookies = {
#     "ASP.NET_SessionId": "lxayqhhskmsgh51be30j04zj",
#     "languageS": "China",
#     "Userlanguages": "China",
#     "security_session_verify": "a96df5b7be177b9d8d47fea60551cee1",
#     # "": "",
# }
# headers = {
#     "Origin": "http://218.104.65.183:8080",
#     "X-Requested-With": "XMLHttpRequest",
#     "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36",
#     "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
#     "Referer": "http://218.104.65.183:8080/Ext/MainPage.aspx",
#     # "": "",
#     # "": "",
# }
# import requests
# res = requests.get(url=base_url, headers=headers, cookies=cookies)
# img_data = res.content
# with open('./xxx.png', 'wb') as f:
#     f.write(img_data)

# res = '346#308#1@194#336#2@386#137#3@426#359#4@437#282#5@524#121#6@494#61#7'
# info_l = res.split("@")
# _dict = {i.split("#")[2]:{"x":i.split("#")[0], "y":i.split("#")[1]} for i in info_l}
# print(_dict)

# print(not ('' == ''))
# s_cid = ['4801745_2010', '4770807_2010', '4801746_2010', '4602120_2010', '4714950_2010', '3550739_2010', '3688061_2010', '3688061_3040', '4696908_2010', '4696908_3040', '4730416_2010', '3597369_2010', '4716617_2010', '4716617_3040', '4607586_2010', '4607586_3040', '4718191_2010', '4718191_3040', '4607540_2010', '4607540_3040', '4716616_2010', '4716616_3040', '4696632_2010', '4696632_3040', '4730068_2010', '4730069_2010', '4718190_2010', '4718190_3040', '4607574_2010', '4607574_3040', '4801747_2010', '3690757_2010', '3690757_3040', '4730070_2010', '4607573_2010', '4607573_3040', '4394184_2010', '4718189_2010', '4718189_3040', '4801748_2010', '4692169_2010', '4692227_2010', '4692893_2010', '4692183_2010', '4692891_2010', '4720123_2010', '4720149_2010', '4720139_2010', '4720128_2010', '4720148_2010', '4801758_2010', '4508348_2010', '4623538_2010', '4588455_2010', '4692314_2010', '4692188_2010', '4692217_2010', '4692164_2010', '4692279_2010', '4692245_2010', '4692195_2010', '4720154_2010', '4720155_2010', '4720156_2010', '4720158_2010', '4726562_2010', '4720125_2010', '4720134_2010', '4720120_2010', '4827029_2010', '4508425_2010', '4692251_2010', '4692894_2010', '4692294_2010', '4692240_2010', '4692212_2010', '4692200_2010', '4720124_2010', '4720151_2010', '4720121_2010', '4720137_2010', '4720144_2010', '4720146_2010', '4801752_2010', '4801760_2010', '4692250_2010', '4692222_2010', '4692264_2010', '4692174_2010', '4692319_2010', '4692207_2010', '4720160_2010', '4730412_2010', '4720145_2010', '4829278_2010', '4829279_2010', '4395596_2010', '4692190_2010', '4692895_2010', '4692304_2010', '4692269_2010', '4692890_2010', '4720152_2010', '4692256_2010', '4720130_2010', '4720131_2010', '4730415_2010', '4829281_2010', '4801751_2010', '4801753_2010', '4801754_2010', '4801759_2010', '4801757_2010', '4829276_2010', '4835715_2010', '4623617_2010', '4692892_2010', '4587673_2010', '4692289_2010', '4692235_2010', '4720150_2010', '4720159_2010', '4722312_2010', '4720118_2010', '4720136_2010', '4720138_2010', '4801756_2010', '4829280_2010', '4692309_2010', '4692182_2010', '4692258_2010', '4692299_2010', '4692189_2010', '4692274_2010', '4720157_2010', '4720161_2010', '4730414_2010', '4720119_2010', '4720132_2010', '4720133_2010', '4730413_2010', '4720141_2010', '4720142_2010', '4720147_2010', '4829277_2010', '4692284_2010', '4692196_2010', '4720135_2010', '4720153_2010', '4726563_2010', '4720127_2010', '4720126_2010', '4720129_2010', '4720122_2010', '4720140_2010', '4720143_2010', '4835718_3040', '3591363_3040', '4723816_3040', '4705126_3040', '4705133_3040', '4705140_3040', '4394509_3040', '4705128_3040', '4715133_3040', '4835731_3040', '4835725_3040', '4852606_3040', '4514517_3040', '4705137_3040', '4705139_3040', '4832580_3040', '4835723_3040', '4723815_3040', '4705125_3040', '4705145_3040', '4701557_3040', '4715132_3040', '4835730_3040', '4832577_3040', '4835721_3040', '4705138_3040', '4705130_3040', '4705143_3040', '4705144_3040', '4705146_3040', '4835724_3040', '4807630_3040', '4832579_3040', '4835726_3040', '4835727_3040', '4835729_3040', '4835720_3040', '3226995_3040', '4701556_3040', '4705148_3040', '4705127_3040', '4705135_3040', '4705136_3040', '4835728_3040', '4850483_3040', '4850481_3040', '4705123_3040', '4832578_3040', '4852604_3040', '4514509_3040', '4061467_3040', '4395208_3040', '4705147_3040', '4835722_3040', '3410209_3040', '4514485_3040', '4514483_3040', '4074605_3040', '4723817_3040', '4705142_3040', '4835732_3040', '4807631_3040', '4850484_3040', '4852605_3040', '3754382_2040', '3881148_2040', '4637056_2040', '4636174_2040', '4858414_2040', '3817341_2040', '4073712_2040', '3995117_2040', '3995118_2040', '3855116_2040', '4636173_2040', '4636698_2040', '3804049_2040', '3804738_2040', '4059274_2040', '4109607_2040', '3854890_2040', '3816727_2040', '4636762_2040', '4636702_2040', '4149350_2040', '3945026_2040', '3829576_2040', '3791290_2040', '4122648_2040', '3970804_2040', '4008090_2040', '4637099_2040', '3767250_2040', '4123455_2040', '4637602_2040', '4636774_2040', '3997280_2040', '4636713_2040', '3932375_2040', '3931982_2040', '4514563_2040', '3906190_2040', '3816924_2040', '3957532_2040', '4636172_2040', '4636775_2040', '4596361_2040', '4541203_2020', '4541202_2020', '4541204_2020', '4581480_2020', '4581479_2020', '4581481_2020', '4609809_2020', '4805876_2020', '4514017_2020', '4508839_2020', '4510278_2020', '4060463_2020', '4509537_2020', '4805877_2020', '4057865_2020', '4609810_2020', '3969492_2020', '3968865_2020', '4514242_2020', '4136260_2020', '4723805_2020', '4706438_2020', '4696416_2020', '4708658_2020', '4723806_2020', '4706437_2020', '4696415_2020', '4696414_2020', '4708657_2020', '4801734_2020', '4509802_2020', '4708656_2020', '4488884_2020', '4511300_2020', '4512769_2020', '4510559_2020', '4723809_2020', '4701549_2020', '3401449_2020', '4706115_2020', '4722133_2020', '4723807_2020', '4723810_2020', '4706112_2020', '4722132_2020', '4834715_2020', '4706117_2020', '4834717_2020', '4834716_2020', '4878689_2020', '4878690_2020', '4706113_2020', '4706114_2020', '4706116_2020', '4878691_2020', '4701551_2020', '4509110_2020', '4709328_2020', '4701548_2020', '4709509_2020', '4701547_2020', '4704573_2020', '4701552_2020', '4701553_2020', '4701555_2020', '4701546_2020', '4701550_2020', '4701554_2020', '4709508_2020', '4720723_2020', '4720722_2020', '4859137_2020', '4859139_2020', '4859144_2020', '4806022_2020', '4859136_2020', '4859140_2020', '4720719_2020', '4720720_2020', '4806023_2020', '4859138_2020', '4859135_2020', '4859141_2020', '4720721_2020', '4859134_2020', '4871277_2020', '4871278_2020', '4871279_2020', '4871280_2020', '4871276_2020', '4871281_2020', '4801739_2020', '4801742_2020', '4794835_2020', '4674394_2020', '4674407_2020', '4674398_2020', '4674396_2020', '4838071_2020', '4801740_2020', '4674409_2020', '4838072_2020', '4674403_2020', '4794833_2020', '4674400_2020', '4674404_2020', '4674406_2020', '4842416_2020', '4842417_2020', '4794836_2020', '4645367_2020', '4672569_2020', '4801744_2020', '4674408_2020', '4674405_2020', '4801735_2020', '4794831_2020', '4842415_2020', '4674397_2020', '4674433_2020', '4674429_2020', '4801736_2020', '4624243_2020', '4794832_2020', '4825850_2020', '4801743_2020', '4644044_2020', '4674432_2020', '4794830_2020', '4801737_2020', '4794834_2020', '4674393_2020', '4674401_2020', '4674430_2020', '4824464_2020', '4801738_2020', '4624244_2020', '4674426_2020', '4674395_2020', '4674428_2020', '4674399_2020', '4674402_2020', '4644896_2020', '4674431_2020', '4674427_2020', '4659740_2020', '4801741_2020', '4602119_2020', '4602117_2020', '4602118_2020', '4878024_2020', '4878025_2020', '4775170_2020', '4903143_2020', '4511788_2020', '4710690_2020', '4615555_2050', '4635333_2050', '4843293_2050', '4843292_2050', '4833607_2050', '4852825_2050', '4371845_2020', '4852884_2020', '4674423_2020']
#
# g_cid = ['4730416_3040', '4801747_3040', '4801748_3040', '3690451_2010', '3688395_2010', '3690058_2010', '4419653_2010', '3690169_2010', '3689689_2010', '3689623_2010', '3689423_2010', '3690341_2010', '3689429_2010', '3689719_2010', '3690145_2010', '3689952_2010', '3689560_2010', '3690489_2010', '3689896_2010', '4394509_2010', '3470055_3040', '4395208_2010', '4646236_3040', '4646243_3040', '4646230_3040', '4646246_3040', '4646247_3040', '4646237_3040', '4646231_3040', '4646233_3040', '4646240_3040', '4646241_3040', '4646242_3040', '4646239_3040', '4645681_3040', '4646232_3040', '4646234_3040', '4645701_3040', '4646245_3040', '4646235_3040', '4646238_3040', '4646244_3040', '4427627_2010', '4427625_2010', '4477078_2010', '4656956_2010', '4656961_2010', '4656950_2010', '4656965_2010', '4656967_2010', '4395552_2010', '4656968_2010', '4427624_2010', '4656958_2010', '4656962_2010', '4656963_2010', '4656952_2010', '4656953_2010', '4427622_2010', '4427626_2010', '4427628_2010', '4427800_2010', '4427630_2010', '4508559_2010', '4656957_2010', '4656959_2010', '4656954_2010', '4427629_2010', '4427951_2010', '4394556_2010', '4656960_2010', '4393844_2010', '4427631_2010', '4656951_2010', '4656964_2010', '4656966_2010', '4427623_2010', '4394504_2010', '4656955_2010', '4643381_2040', '4643388_2040', '4643389_2040', '4643404_2040', '4643403_2040', '4643394_2040', '4643395_2040', '4643396_2040', '4643386_2040', '4643391_2040', '4643392_2040', '4643393_2040', '4643399_2040', '4643405_2040', '4643402_2040', '4643387_2040', '4643400_2040', '4643401_2040', '4643385_2040', '4643390_2040', '4643397_2040', '4643398_2040', '4657687_2020', '4657689_2020', '4657678_2020', '4657680_2020', '4657683_2020', '4657686_2020', '4657691_2020', '4657681_2020', '4657690_2020', '4657677_2020', '4657688_2020', '4657698_2020', '4657692_2020', '4657704_2020', '4657696_2020', '4657697_2020', '4657699_2020', '4657700_2020', '4657706_2020', '4657707_2020', '4657694_2020', '4657701_2020', '4657702_2020', '4657693_2020', '4657695_2020', '4657705_2020', '4657703_2020', '3251339_2020', '3259014_2020', '3553085_2020', '3575861_2020', '4656310_2020', '4655196_2020', '4655025_2020', '4656118_2020', '4656174_2020', '4654853_2020', '4655622_2020', '4655954_2020', '4655508_2020', '4655888_2020', '4655700_2020', '4655404_2020', '4656128_2020', '4655970_2020', '4654440_2020', '4655980_2020', '4655677_2020', '4655350_2020', '4655402_2020', '4657734_2020', '4657754_2020', '4657744_2020', '4657743_2020', '4657742_2020', '4657732_2020', '4657733_2020', '4657741_2020', '4657676_2020', '4643383_2020', '4657671_2020', '4657670_2020', '4657672_2020', '4657673_2020', '4657674_2020', '4657668_2020', '4657669_2020', '4653033_2020', '4652852_2020', '4653266_2020', '4652835_2020', '4652974_2020', '4643382_2020', '4657751_2020', '4657752_2020', '4657711_2020', '4657746_2020', '4657721_2020', '4657722_2020', '4657712_2020', '4657709_2020', '4657735_2020', '4657747_2020', '4657727_2020', '4657728_2020', '4657755_2020', '4657715_2020', '4657723_2020', '4657740_2020', '4657745_2020', '4657750_2020', '4647681_2020', '4657724_2020', '4657753_2020', '4657710_2020', '4657719_2020', '4657743_2020', '4657748_2020', '4657749_2020', '4647682_2020', '4657725_2020', '4657729_2020', '4657730_2020', '4657732_2020', '4657737_2020', '4657741_2020', '4657717_2020', '4657726_2020', '4657714_2020', '4657731_2020', '4657733_2020', '4657734_2020', '4657736_2020', '4657739_2020', '4657718_2020', '4657720_2020', '4657738_2020', '4657716_2020', '4657744_2020', '4657754_2020', '4657713_2020', '4657742_2020', '4656598_2020', '4657682_2020', '4657679_2020', '4657675_2020', '4513997_2020', '4657685_2020']
# print(len(s_cid))
# print(len(g_cid))
# import redis
# r = redis.Redis()
# from MysqlTools import MysqlTools
# db = dict(
#     host="127.0.0.1",
#     port=3306,
#     user="root",
#     passwd="123456",
#     db="JAC",
#     charset="utf8",
# )
# curs = MysqlTools(db_config=db, type='dict')
# sql = '''select distinct level1_code from all_level_info_copy;'''
# cid_info = curs.select_all(sql)
# cid_list = [i.get("level1_code") for i in cid_info]
# print(len(set(s_cid)))
# print(len(cid_list))
# for i in s_cid:
#     if i not in cid_list:
#         print(i)

# _dict = dict(
#     uid='',
#     name='轿车',
#     brand='jac',
#     brandCode='jac',
#     condition='和悦RS（服务）',
#     limit='-',
#     limit2='江淮和悦RS',
#     limit3='江淮和悦RS(轿车、SUV)',
#     limit4='',
#     label='',
#     code='',
#     description='',
#     imagePath='',
#     imgName='',
#     extra_info='',
#     updatetime='now()',
#     createtime='now()'
# )
# from MysqlTools import MysqlTools
# import hashlib
# def get_md5(str):
#     '''获取md5加密电子指纹'''
#     md5 = hashlib.md5()
#     md5.update(str)
#     return md5.hexdigest()
#
# db_config = dict(
#     host="127.0.0.1",
#     port=3306,
#     user="root",
#     passwd="123456",
#     db="JAC",
#     charset="utf8",
# )
# db = MysqlTools(db_config=db_config, type='dict')
# RS = '''4671958@和悦RS订货指导汇编@../Ext/image/img.png@BMPV-00-F@0@2017/5/23 0:00:00@2037/12/31 0:00:00@0@1@@2020@@1@0@江淮和悦RS@78286020@25@和悦RS订货指导汇编 BMPV-00-F@@0@$4671959@和悦RS1.8MT/Ⅳ@../Ext/image/img.png@BMPV-01-F@0@2017/5/23 0:00:00@2037/12/31 0:00:00@1@1@@2020@@1@0@江淮和悦RS@78286021@89@和悦RS1.8MT/Ⅳ BMPV-01-F@@0@$4671960@和悦RS1.8MT/Ⅳ/深@../Ext/image/img.png@BMPV-02-F@0@2017/5/23 0:00:00@2037/12/31 0:00:00@2@1@@2020@@1@0@江淮和悦RS@78290465@86@和悦RS1.8MT/Ⅳ/深 BMPV-02-F@@0@$4671961@和悦RS1.5MT/Ⅳ@../Ext/image/img.png@BMPV-03-F@0@2017/5/23 0:00:00@2037/12/31 0:00:00@3@1@@2020@@1@0@江淮和悦RS@78290466@85@和悦RS1.5MT/Ⅳ BMPV-03-F@@0@$4671962@和悦RS1.5MT/Ⅳ/深@../Ext/image/img.png@BMPV-04-F@0@2017/5/23 0:00:00@2037/12/31 0:00:00@4@1@@2020@@1@0@江淮和悦RS@78290467@84@和悦RS1.5MT/Ⅳ/深 BMPV-04-F@@0@$4671963@和悦RS1.8AT/IV@../Ext/image/img.png@BMPV-05-F@0@2017/5/23 0:00:00@2037/12/31 0:00:00@5@1@@2020@@1@0@江淮和悦RS@78290468@85@和悦RS1.8AT/IV BMPV-05-F@@0@$4671964@和悦RS1.8AT/Ⅳ/深@../Ext/image/img.png@BMPV-06-F@0@2017/5/23 0:00:00@2037/12/31 0:00:00@6@1@@2020@@1@0@江淮和悦RS@78290469@83@和悦RS1.8AT/Ⅳ/深 BMPV-06-F@@0@$4671965@和悦RS1.8MT/Ⅳ/深年4GA5@../Ext/image/img.png@BMPV-07-F@0@2017/5/23 0:00:00@2037/12/31 0:00:00@7@1@@2020@@1@0@江淮和悦RS@78290470@89@和悦RS1.8MT/Ⅳ/深年4GA5 BMPV-07-F@@0@$4671966@和悦RS1.8AT/Ⅳ/深年@../Ext/image/img.png@BMPV-08-F@0@2017/5/23 0:00:00@2037/12/31 0:00:00@8@1@@2020@@1@0@江淮和悦RS@78290471@84@和悦RS1.8AT/Ⅳ/深年 BMPV-08-F@@0@$4671967@和悦RS1.5MT/Ⅳ/深年4GB@../Ext/image/img.png@BMPV-09-F@0@2017/5/23 0:00:00@2037/12/31 0:00:00@9@1@@2020@@1@0@江淮和悦RS@78290472@90@和悦RS1.5MT/Ⅳ/深年4GB BMPV-09-F@@0@'''
# car_l = RS.split('$')
# for car in car_l:
#     info_l = car.split('@')
#     str = '轿车'+'jac'+'和悦RS（服务）'+'-'+'江淮和悦RS'+'江淮和悦RS(轿车、SUV)'+info_l[1]
#     md5 = get_md5(str.encode())
#     _dict['uid'] = md5
#     _dict['limit4'] = info_l[1]
#     cid = info_l[0]+'_'+info_l[10]
#     _dict['code'] = cid
#     insql = db.get_insert_sql('cars_info_collection_RS', _dict)
#     db.execute_sql(insql, commit=True)


